{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Python命令行模式&交互模式\n",
    "\n",
    "### 命令行模式\n",
    "\n",
    "在系统命令行执行python文件\n",
    "\n",
    "`c:\\python hello_world.py`\n",
    "\n",
    "不会自动返回值，需要使用print()。\n",
    "\n",
    "\n",
    "### 交互模式\n",
    "\n",
    "命令行使用python进入交互模式\n",
    "```\n",
    "   c:\\python\n",
    "   >>>\n",
    "```\n",
    "每行输入的命令都会立即执行并返回结果\n",
    "\n",
    "### 运行python文件\n",
    "1 win\n",
    "   \n",
    "   `python hello.py`\n",
    "   \n",
    "2 linux\n",
    "   * $python hello.py\n",
    "   * 直接运行\n",
    "      在.py文件第一行添加\n",
    "      \n",
    "      ` #!/usr/bin/env python3`\n",
    "      \n",
    "      添加执行权限\n",
    "      \n",
    "      `chmod a+x hello.py`\n",
    "      "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
